interface Bird {
    weight: number
    leg: number
    wings: number
}


class MyBird {
    weight!: number
    leg!: number
    wings!: number
}

type T1 = Omit<Bird, never>
type T2 = Omit<MyBird, never>

let x1!: T1
let x2!: T2
x1 = x2


// 接口支持重名，会自动合并
interface Bird2 {
    weight1: number
    leg2: number
    wings3: number
}
interface Bird2 {
    weightewwwwwfj: number
    le: number
    win: number
}

interface MyClass {
    x: number
}
class MyClass implements MyClass {
    wight!: number
}
MyClass.prototype.x = 100

interface IFoo {
    foo(s: string): void
}

class Foo1 implements IFoo{
    foo(s: string): void {
        console.log(s)
    }
}


class Foo2 {
    foo(): number {return 1}
}
let xx1: IFoo = new Foo1() // Foo1是IFoo的子类，子类兼容(显示实现)

let xx2: IFoo = new Foo2() // Foo 结构是兼容 IFoo的，结构兼容(隐式实现) 只要函数结构一样就可以赋值(函数名一样就能赋值, 不用管参数和返回值)